﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using myMapObj;

namespace FakeGUI
{
    public partial class Form_Identify : Form
    {
        //字段：查询到的要素集合
        private moFeatures _IdentifyFeatures;

        //属性：查询到的要素集合
        public moFeatures IdentifyFeatures
        {
            get { return _IdentifyFeatures; }
            set { _IdentifyFeatures = value; }
        }

        //默认构造函数
        public Form_Identify()
        {
            InitializeComponent();
        }
        //传递要素集合的构造函数
        public Form_Identify(moFeatures features)
        {
            _IdentifyFeatures = features;
        }
        private void Form_Identify_Load(object sender, EventArgs e)
        {
            //InitializeComboBox();
            //ComboBox_Features.SelectedIndex = 0;
            
        }
        private void InitializeComboBox()
        {
            moFeature CurrentFeature;
            moAttributes CurrentAttributes;
            object MarkAttribute;
            string MarkString;
            for (int i = 0; i < _IdentifyFeatures.Count; ++i)
            {
                CurrentFeature = _IdentifyFeatures.GetItem(i);
                CurrentAttributes = CurrentFeature.Attributes;
                MarkAttribute = CurrentAttributes.GetItem(3);//ArcGIS中，属性前两项为FID、Shape,以第三项属性值来标记要素
                MarkString = ((List<object>)MarkAttribute)[1].ToString();//[0]为字段名，[1]为属性值
                ComboBox_Features.Items.Add(MarkString);
            }
        }
        private void ComboBox_Features_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoadDataGrid();
            LoadLocation();
        }
        private void LoadDataGrid()
        {

        }
        private void LoadLocation()
        {

        }


    }
}
